import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '告警状态,1：待处理；2：已通知：3：已分析；4：已解除',
    align: "center",
    dataIndex: 'alarmStatus_dictText'
  },
  {
    title: '解除时间',
    align: "center",
    dataIndex: 'releaseTime'
  },
  {
    title: '钻孔',
    align: "center",
    dataIndex: 'drill'
  },
  {
    title: '告警内容',
    align: "center",
    dataIndex: 'alarmContent'
  },
  {
    title: '告警时间',
    align: "center",
    dataIndex: 'alarmTime'
  },
  {
    title: '原因类型',
    align: "center",
    dataIndex: 'reasonType_dictText'
  },
  {
    title: '原因分析',
    align: "center",
    dataIndex: 'reasonAnalysis'
  },
  {
    title: '测点编码',
    align: "center",
    dataIndex: 'stationCode'
  },
  {
    title: '机构/部门名称',
    align: "center",
    dataIndex: 'departName_dictText'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "告警状态,1：待处理；2：已通知：3：已分析；4：已解除",
    field: 'alarmStatus',
    component: 'JDictSelectTag',
    componentProps:{
    },
    //colProps: {span: 6},
  },
  {
    label: "原因类型",
    field: 'reasonType',
    component: 'JDictSelectTag',
    componentProps:{
    },
    //colProps: {span: 6},
  },
  {
    label: "机构/部门名称",
    field: 'departName',
    component: 'JDictSelectTag',
    componentProps:{
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '告警状态,1：待处理；2：已通知：3：已分析；4：已解除',
    field: 'alarmStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: ""
    },
  },
  {
    label: '解除时间',
    field: 'releaseTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '钻孔',
    field: 'drill',
    component: 'Input',
  },
  {
    label: '告警内容',
    field: 'alarmContent',
    component: 'Input',
  },
  {
    label: '告警时间',
    field: 'alarmTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '原因类型',
    field: 'reasonType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: ""
    },
  },
  {
    label: '原因分析',
    field: 'reasonAnalysis',
    component: 'Input',
  },
  {
    label: '测点编码',
    field: 'stationCode',
    component: 'Input',
  },
  {
    label: '机构/部门名称',
    field: 'departName',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: ""
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  alarmStatus: {title: '告警状态,1：待处理；2：已通知：3：已分析；4：已解除',order: 0,view: 'list', type: 'string',,},
  releaseTime: {title: '解除时间',order: 1,view: 'datetime', type: 'string',},
  drill: {title: '钻孔',order: 2,view: 'text', type: 'string',},
  alarmContent: {title: '告警内容',order: 3,view: 'text', type: 'string',},
  alarmTime: {title: '告警时间',order: 4,view: 'datetime', type: 'string',},
  reasonType: {title: '原因类型',order: 5,view: 'list', type: 'string',,},
  reasonAnalysis: {title: '原因分析',order: 6,view: 'text', type: 'string',},
  stationCode: {title: '测点编码',order: 7,view: 'text', type: 'string',},
  departName: {title: '机构/部门名称',order: 8,view: 'list', type: 'string',,},
};
